#include <stdio.h>
struct student{
	 char num[6];
	 char name[11];
	 int grade;
};
int main(){
	int n, i,sum=0;
	float average;
	scanf("%d",&n);
	struct student a[n];
	for(i=0;i<n;i++){
		scanf("%s %s %d",a[i].num,a[i].name,&a[i].grade);
	}
	for(i=0;i<n;i++){
		sum+=a[i].grade;
		}
		average = sum/n;
		printf("%.2f\n",average);
	
	for(i=0;i<n;i++){
		if(a[i].grade<average){
			printf("%s %s\n",a[i].name,a[i].num);
			
		}
	}
	return 0;
}
